const Mock = require('mockjs')
const data = Mock.mock({
    'items|30': [{ 
        user: () => {                                            //账号名称                   
            const randomLength = Mock.Random.integer(2, 3);
            let chineseCharacters = '';
            for (let i = 0; i < randomLength; i++) {
                chineseCharacters += String.fromCharCode(Mock.Random.integer(0x4e00, 0x9fa5));
            }
            return chineseCharacters;
        },                               
        logs: () => {                                           //日志
            const randomLength = Mock.Random.integer(10, 20);
            let chineseCharacters = '';
            for (let i = 0; i < randomLength; i++) {
                chineseCharacters += String.fromCharCode(Mock.Random.integer(0x4e00, 0x9fa5));
            }
            return chineseCharacters;
        },
        display_time: '@datetime',     //操作时间
    }]
})

module.exports = [
    {
        url: '/vue-admin-template/dataManage/disposition',
        type: 'get',
        response: config => {
            const items = data.items
            return {
                code: 20000,
                data: {
                    total: items.length,
                    items: items
                }
            }
        }
    }
]
